/*
 * @Author: 0x9DEFA478
 * @Date: 2025-08-03 23:24:06
 * @LastEditTime: 2025-08-17 19:04:39
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * 
 */
#ifndef hHMakeTargetTask_C_CPP_HPP_
#define hHMakeTargetTask_C_CPP_HPP_
#include "HMakeTargetConfig.hpp"
#include "HMakeTargetTask_Abstract.hpp"
#include "HMakeDependencyItem_Instance.hpp"
#include "HMakeLog.hpp"




namespace HMake{

  class TargetTask_GCC:public TargetTask{

    public:
      template<typename... T_Arg>
      static Pointer New(T_Arg&&... Args){
        return Pointer(new TargetTask_GCC(std::forward<T_Arg>(Args)...));
      }

    public:
      TargetTask_GCC(const TargetConfig::Pointer& targetConfig
        ,const DependencyChain::Item::Pointer& hmkFileDependency
        ,const std::string& cwd,const std::string& shell
        ,DependencyItem_Directory::Collection::Pointer& DirectoryCollection
        ,Log::Pointer& log
        ,AttributeMask Attribute);
      ~TargetTask_GCC();

      virtual DependencyChain::Item::Pointer MakeTask()override;


    private:
      enum class SrcTaskType{
        CC,
        CXX,
        AS
      };

      DependencyChain::Item::Pointer MakeSrcTask_CC_CXX_AS(const H::Path& SourcePath,const H::Path& TargetPath,SrcTaskType Type);

    private:
      DependencyChain::Item::Pointer hmkFileDependency;
      DependencyItem_Directory::Collection::Pointer DirectoryCollection;
      Log::Pointer log;
      const std::string cwd;
      DependencyItem_SystemProcess::Task_Process::IOEncoding io_encoding;
      std::list<std::string> CC;
      std::list<std::string> CXX;
      std::list<std::string> AS;
      std::list<std::string> LD;
      std::list<std::string> AR;
      std::string TargetType;
      std::string CompilerPrefix;
  };

}




#endif //hHMakeTargetTask_C_CPP_HPP_
